package cn.edu.zut.soft.student.config;

import cn.edu.zut.soft.student.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author ChrisPhantom
 * @CreatDate 2021/02/25 10:41
 */

@Configuration
public class MyWebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/", "/login", "/*/api/**", "/css/**", "/excel/**", "/fontawesome/**", "/img/**", "/js/**");
    }
}
